from fastapi import APIRouter, Depends

from forward.api.h5.schemas.lucky.code import CodeDetailInSchema
from forward.api.h5.service.lucky.code import CodeService

code = APIRouter(prefix="/code")


@code.post("/detail")
async def get_code(
    detail_in: CodeDetailInSchema,
    code_service: CodeService = Depends(),
):
    return await code_service.detail(detail_in.code)
